﻿Imports System
Imports System.Data.SqlClient
Imports System.Data

Public Class Maintenance
    Inherits System.Web.UI.Page

    'Open the connection to the database
    Dim con As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("MainConn").ConnectionString)


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim strSQLcount As String
        strSQLcount = "SELECT COUNT(MembershipId) FROM MembershipCodesTable"
        Dim cmd As New SqlCommand(strSQLcount, con)

        con.Open()
        Dim objReader As SqlDataReader = cmd.ExecuteReader()
        dgACount.DataSource = objReader
        dgACount.DataBind()
        objReader.Close()

        Dim strSQLData As String
        strSQLData = "SELECT MembershipID, MembershipType, UnitPrice FROM MembershipCodesTable"
        cmd.CommandText = strSQLData
        objReader = cmd.ExecuteReader()
        SeasonPassDataGrid.DataSource = objReader
        SeasonPassDataGrid.DataBind()

        con.Close()

    End Sub

End Class